package ${module.jacksonFilterPackage};

import java.util.HashSet;
import java.util.Set;

import ${beanModule.entityPackage}.${entityName};
import com.fasterxml.jackson.databind.ser.FilterProvider;
import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;

/**
 * @author Moyq5's MvcMaker Tools
 */
public abstract class ${entityName}Filter {

	public static FilterProvider getId() {
		final Set<String> ${lowerName} = new HashSet<String>();
		${lowerName}.add("${idName}");
		
		return new SimpleFilterProvider().addFilter(
				${entityName}.class.getSimpleName(),
				SimpleBeanPropertyFilter.filterOutAllExcept(${lowerName}));
	}

	public static FilterProvider get() {
		final Set<String> ${lowerName} = new HashSet<String>();
		<#list fieldNames as fieldName>
		${lowerName}.add("${fieldName}");
		</#list>
		
		return new SimpleFilterProvider().addFilter(
				${entityName}.class.getSimpleName(),
				SimpleBeanPropertyFilter.filterOutAllExcept(${lowerName}));
	}

}
